//
//  ZXCustomeCate.m
//  ZiJinLian
//
//  Created by 震霄 张 on 2018/3/11.
//  Copyright © 2018年 lzy. All rights reserved.
//

#import "ZXCustomeCate.h"

@interface ZXCustomeCate()
@property (weak, nonatomic) IBOutlet UIImageView *iconView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;

@end

@implementation ZXCustomeCate

+(instancetype)zxcustomeCate
{
	return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil].lastObject;

}
-(void)awakeFromNib
{
	[super awakeFromNib];
	self.autoresizingMask = UIViewAutoresizingNone;
}
-(void)setModel:(HomeRequstModel *)model
{
	_model = model;
	[self.iconView sd_setImageWithURL:[NSURL URLWithString:model.imageUrl] placeholderImage:[UIImage imageNamed:@""]];
	self.titleLabel.text = model.name;
	
}
- (IBAction)btnClick:(id)sender {
	if (self.model) {
		NSLog(@"click%@",self.model.name);
		NSMutableDictionary *dic = [NSMutableDictionary dictionary];
		[dic setValue:@"5" forKey:@"type"];
		[dic setValue:[NSString stringWithFormat:@"%ld",self.model.ID] forKey:@"value"];
		[[NSNotificationCenter defaultCenter]postNotificationName:@"jumpOther" object:nil userInfo:dic];
		
	}
}

@end
